using System;
using System.Text;
using System.Net;
using MIS.EN.Exchange.Entities;

namespace MIS.EN.Exchange
{
    internal class ContactFolderWorker : FolderWorker<Contact>
    {
        public ContactFolderWorker(NetworkCredential credentials, bool useFormsBasedAuthentication, bool useIsaServer2006)
            : base(credentials, useFormsBasedAuthentication, useIsaServer2006)
        {
        }

        protected override void BuildContentClassNode(StringBuilder xmlBuilder)
        {
            xmlBuilder.Append("urn:content-classes:person");
        }

        protected override void BuildMessageClass(StringBuilder xmlBuilder)
        {
            xmlBuilder.Append("IPM.Contact");
        }

        protected override string FolderName
        {
            get { return "Contacts"; }
        }

        protected override Type ItemType
        {
            get { return typeof(Contact); }
        }

        protected override void BuildNamespaces(bool useWebDavReplication)
        {
            base.BuildNamespaces(useWebDavReplication);
            base.WebDavDocumentNamespaces.Add("con", "urn:schemas:contacts:");
            base.WebDavDocumentNamespaces.Add("cal", "urn:schemas:calendar:");
            base.WebDavDocumentNamespaces.Add("mail", "urn:schemas:httpmail:");
        }

        protected override string PropertyMappingsFileName
        {
            get { return "MIS.EN.Exchange.PropertyMappings.ContactPropertyMappings.xml"; }
        }

        protected override bool UsesHexadecimalXmlNames
        {
            get { return false; }
        }
    }
}
